<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
    <title>ADMIRAL: Data Submission</title>

    <!-- TODO: move to separate CSS file -->
    <style>
    td {
        background-color: #FFE;
    }
    </style>
 
    <link rel="stylesheet" href="./../css/SubmitDataset.css" type="text/css" />   
    
    <!-- Import jQuery framework -->
    <script type="text/javascript" src="../../jQuery/js/jquery-1.4.2.js"></script> 

    <!-- Import jQuery additional libraries -->
    <script type="text/javascript" src="../../jQuery/jquery.json-2.2.js"></script> 
    
    <!-- Import treeview plugin -->
    <link rel="stylesheet" href="../../jQuery/jquery-treeview/jquery.treeview.css" type="text/css" />
    <script type="text/javascript" src="../../jQuery/jquery-treeview/jquery.treeview.js"></script>
  
 
    <!-- Import MochiKit modules: require MochiKit library functions to be fully qualified -->
    <script type="text/javascript">MochiKit = {__export__: false};</script>
    <script type="text/javascript" src="../../MochiKit/Base.js"></script>
    <script type="text/javascript" src="../../MochiKit/Iter.js"></script>
    <script type="text/javascript" src="../../MochiKit/Logging.js"></script>

    <!-- Import generic code from the dataset utils package -->
    <script type="text/javascript" src="../../DatasetUtils/js/DatasetTree.js"></script>
       
    <!-- Import Admiral functions -->
    <script type="text/javascript" src="../../Admiral/admiral-base.js"></script>
    <script type="text/javascript" src="../../Admiral/Error.js"></script>
    <script type="text/javascript" src="../../Admiral/AsyncComputation.js"></script>
    <script type="text/javascript" src="./../js/SubmitDatasetDetails.js"></script>
    <script type="text/javascript" src="./../js/DirectoryListing.js"></script>
    <script type="text/javascript" src="./../js/GetDatasetMetadata.js"></script>
    <script type="text/javascript" src="./../js/DirectoriesOnlyDatasetTree.js"></script>
    <script type="text/javascript" src="../../SelectDataset/ListDatasets.js"></script>
    <script type="text/javascript" src="../../SelectDataset/GetDatasetsList.js"></script>
    <script type="text/javascript" src="../../SelectDataset/GetDatasetDetails.js"></script>
    
    <script>
    // Use jQuery via jQuery(...)
    jQuery.noConflict();
    </script>
    
    <script>
    jQuery(document).ready( function ()
    {  
       jQuery("#cancel").click( function()
       {   
            cancelURL = "/";
            jQuery("#submitForm").attr('action', cancelURL); 
            return true;
       });
    
       url = document.URL;
       
       // Get Dir value from the url to display as default and get metadata information for the dataset dir
       var pos = url.indexOf("=");
       var dir="" ;
       if(pos > 0)
       {
         dir= url.slice(url.indexOf("=")+1);
        //var dir = url.split("=");
       }
       admiral.displayFormFieldsFromMetadata(dir); 
    });
    </script>
    
</head> 

<body>
    <div>
        <span id="logo"><a href="/"><img alt="site_logo" src="/images/AdmiralToDataBank-284x100.png" border="0"/></a></span>
        <!-- 
        <span><a href="http://databank.ora.ox.ac.uk"><img name="databank_logo" id="databank_logo" alt="databank_logo" src="http://databank.ora.ox.ac.uk/static/databank_logo_generic.png" border="0"/></a></span>
        <span id="logout"><a href="../../SubmitDatasetHandler/cgi-bin/LogoutHandler.py">logout</a></span> -->
    </div>

   <h2>Submit an ADMIRAL data package to the Oxford DataBank</h2>

   <h3>Select a data package for submission</h3>
   <form id="submitForm" name="submitForm" action="../../SubmitDatasetHandler/cgi-bin/SubmitDatasetDetailsHandler.py" method="post">
   <div class="section">  
        <div class="box">  
            <span class="label">
                <span class="mainlabel">
                    Choose an ADMIRAL directory :
                </span>
            </span>       
            <span class="labelvalue">
                <span class="sublabelvalue">
                    <input name="datDir" id="datDir" type="text" value="" size="63" />
                </span>  
                <span class="sublabel">
                    (Choose the directory containing all the content you wish to include in the data package, by clicking on it.
                     This may include sub-directories. All files within the chosen directory will be submitted as a DataBank package)
                </span>       
                <span class="sublabelvalue">
                    <span id="dirtreelist"> </span>
                </span>  
            </span> 
        </div>
        <div class="box">
           <span class="label">
                 <span class="mainlabel">
                       Choose a data package identifier:
                 </span>
           </span>
           <span class="labelvalue">                 
                 <span class="sublabelvalue">
                    <input name="datId" id="datId" type="text"/>
                 </span>
                            <span class="sublabel">
                        (Enter a unique identifier to be used for the DataBank data package.
                        This defaults to the directory name, but another identifier may be entered.
           </span>
           <span class="sublabel">
                        May contain alphanumeric characters and  full stops, underscores, colons and hyphens [.  _  : and  -] but no spaces [ ] or commas [,])
          </span>
           </span>

        </div>
        <div class="box">
           <span class="label">
                 <span class="mainlabel">
                    Create title for data package:
                 </span>
           </span>
           <span class="labelvalue">
             <span class="sublabelvalue">
                <input name="title" id="title" type="text" size="63" />
             </span>
           </span>
        </div>
        <div class="box">
           <span class="label">
               <span class="mainlabel">
                    Add description for data package :
               </span>    
           </span>
           <span class="labelvalue">
                <span class="sublabelvalue">
                    <textarea rows="4"  cols="50" id="description" name="description"></textarea>
                </span>
                <span class="sublabel">
                    (Enter a brief description, explanation or abstract for the data package. You can cut and paste.)
               </span> 
           </span>
        </div>
        <div class="box">
            <span class="labelvalue">
                <!--<input name="cancel" id="cancel" type="submit" value="Home"/>-->
                <input name="submit" id="submit" type="submit" value="Next"/>
           </span> 
        </div>  
        <div class=" sectionSpace">
               <a href="/">Return to ADMIRAL front page</a>
        </div>   
   </div>
</form>  
</body>
</html>

